package service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.AdminDao;

import pojo.Activity;
import pojo.Admin;
import pojo.Item;
import pojo.Referee;
import pojo.User;
import service.AdminService;

@Service("AdminService")
public class AdminServiceImpl implements AdminService {

	@Autowired
	private AdminDao adminDao;

	public Admin login(String adminName, String adminPassword) {
		Admin admin = new Admin();
		admin.setAdminName(adminName);
		admin.setAdminPassword(adminPassword);
		Integer countByParam = this.adminDao.countByParam(admin);
		if (countByParam != null) {
			if (countByParam == 1) {
				Admin findByParam = this.adminDao.findByParam(admin);
				return findByParam;
			}
		}
		return null;
	}

	public boolean grantReferee(User user, Integer gameId) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean cancelReferee(Integer refereeId, Integer gameId) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean initGame(Activity activity, Referee referee, Item item) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean endGame(Activity activity) {
		// TODO Auto-generated method stub
		return false;
	}

}
